package com.minimalist.common.entity.basic.vo.file;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;

import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;

/**
 * 文件上传响应实体
 * @author 11987
 */
@Schema(name = "文件上传响应实体")
public class FileUploadRespVO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    // ==================== 字段定义 ====================
    
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "fileId", description = "文件ID", type = "string")
    private Long fileId;

    @Schema(name = "fileName", description = "文件名称", type = "string")
    private String fileName;

    @Schema(name = "filePath", description = "文件路径", type = "string")
    private String filePath;

    @Schema(name = "fileUrl", description = "文件URL", type = "string")
    private String fileUrl;

    @Schema(name = "fileType", description = "文件类型", type = "string")
    private String fileType;

    @Schema(name = "fileSuffix", description = "文件后缀", type = "string")
    private String fileSuffix;

    @Schema(name = "fileSize", description = "文件大小", type = "string")
    private Long fileSize;

    @Schema(name = "fileSource", description = "文件来源", type = "string")
    private Integer fileSource;

    // ==================== Getter/Setter 方法 ====================
    
    public Long getFileId() {
        return fileId;
    }

    public void setFileId(Long fileId) {
        this.fileId = fileId;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getFilePath() {
        return filePath;
    }

    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    public String getFileUrl() {
        return fileUrl;
    }

    public void setFileUrl(String fileUrl) {
        this.fileUrl = fileUrl;
    }

    public String getFileType() {
        return fileType;
    }

    public void setFileType(String fileType) {
        this.fileType = fileType;
    }

    public String getFileSuffix() {
        return fileSuffix;
    }

    public void setFileSuffix(String fileSuffix) {
        this.fileSuffix = fileSuffix;
    }

    public Long getFileSize() {
        return fileSize;
    }

    public void setFileSize(Long fileSize) {
        this.fileSize = fileSize;
    }

    public Integer getFileSource() {
        return fileSource;
    }

    public void setFileSource(Integer fileSource) {
        this.fileSource = fileSource;
    }

    // ==================== Object 方法重写 ====================

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        FileUploadRespVO that = (FileUploadRespVO) o;
        return Objects.equals(fileId, that.fileId) &&
                Objects.equals(fileName, that.fileName) &&
                Objects.equals(filePath, that.filePath) &&
                Objects.equals(fileUrl, that.fileUrl) &&
                Objects.equals(fileType, that.fileType) &&
                Objects.equals(fileSuffix, that.fileSuffix) &&
                Objects.equals(fileSize, that.fileSize) &&
                Objects.equals(fileSource, that.fileSource);
    }

    @Override
    public int hashCode() {
        return Objects.hash(fileId, fileName, filePath, fileUrl, fileType, fileSuffix, fileSize, fileSource);
    }

    @Override
    public String toString() {
        return "FileUploadRespVO{" +
                "fileId=" + fileId +
                ", fileName='" + fileName + '\'' +
                ", filePath='" + filePath + '\'' +
                ", fileUrl='" + fileUrl + '\'' +
                ", fileType='" + fileType + '\'' +
                ", fileSuffix='" + fileSuffix + '\'' +
                ", fileSize=" + fileSize +
                ", fileSource=" + fileSource +
                '}';
    }
}
